package dao.impl;

import dao.VipDao;
import entity.Vip;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import utils.DruidUtils;

public class VipDaoImpl implements VipDao {
    private JdbcTemplate jdbcTemplate = new JdbcTemplate(DruidUtils.getDataSource());

    @Override
    public Vip getVipById(int id) {
        String sql = "select* from vip where Vid = ?";
        Vip query = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Vip.class), id);
        return query;
    }
}
